<g:render template="../home/header" ></g:render>
<div class="row wid_1000 blk2 mTo_50">
    <div class="col-xs-12">
        <div class="form-horizontal" >
            <input type="hidden" class="input-value" name="userId" id="userId"  value="${userId}"/>
            <div class="form-group  message %{--alert--}%"> </div>
            <div class="kong_20"></div>
            <div class="form-group form-field field-password">
                <label class="col-sm-3 control-label no-padding-right f_l" for="form-password"> 新密码: </label>
                <div class="col-xs-12 col-sm-4 zc_Rtxt f_l">
                    <g:passwordField  name="password" id="form-password" placeholder="请输入新密码" class="width-100" />
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline fieldMsg">  </div>
            </div>


            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right f_l" for="form-passwordAgain">再次输入新密码: </label>
                <div class="col-xs-12 col-sm-4 zc_Rtxt f_l">
                    <g:passwordField  name="passwordAgain" id="form-passwordAgain" placeholder="再次输入新密码" class="width-100" />
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline fieldMsg">  </div>
            </div>

            <div class="clearfix form-actions">
                <div class="col-md-offset-3 col-md-9">
                    <button  onclick="saveNewPwd()" class="btn btn-info" >
                        <i class="icon-ok bigger-110"></i>
                        确定
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>
<r:require module="mng_form"></r:require>
<r:script>
       function saveNewPwd() {
                $.ajax({
                    type: "POST",
                    url: "<g:createLink controller="member" action="saveNewPwd "/>",
                    data: {userId:$('#userId').val(),password:$('#form-password').val(),passwordAgain:$('#form-passwordAgain').val()},
                    dataType: "json",
                    success: function (data) {

                        alert(data.message);
                    },
                    error: function (data, status, e)//服务器响应失败处理函数
                    {
                        alert("请求错误");
                    }
                });
        }
</r:script>
<g:render template="../home/footer" ></g:render>